<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>无人机管理平台</title>
    <style>
        body, html {
            height: 100%;
            margin: 0;
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
        }
        .bg {
            background-image: url('drone-background.jpg');
            height: 100vh;
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .login-container {
            border: 1px solid #ddd;
            padding: 20px;
            border-radius: 5px;
            background-color: rgba(255, 255, 255, 0.9);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            padding: 10px;
            margin: 8px 0;
            box-sizing: border-box;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        .login-button {
            width: 100%;
            padding: 10px;
            font-size: 16px;
            cursor: pointer;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            margin-top: 10px;
        }
        .modules {
            display: none;
            padding: 20px;
        }
        .module {
            background-color: #fff;
            margin: 10px;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            transition: transform 0.3s ease-in-out;
            display: inline-block;
            width: calc(33.333% - 20px);
            vertical-align: top;
        }
        .module:hover {
            transform: translateY(-5px);
        }
        img {
            max-width: 100%;
            height: auto;
            border-radius: 5px;
        }
        .carousel {
            display: none;
        }
    </style>
</head>
<body>

<div class="bg">
    <div class="login-container">
        <input type="text" id="username" placeholder="用户名">
        <input type="password" id="password" placeholder="密码">
        <button class="login-button" onclick="login()">登录</button>
    </div>
</div>

<div class="modules">
    <div class="module" onclick="showCarousel()">
        <img src="live-monitoring-icon.png" alt="实时监控"><br>
        实时监控
    </div>
    <div class="module">
        <img src="ai-monitoring-icon.png" alt="AI监控"><br>
        AI监控
    </div>
    <div class="module">
        <img src="ai-alert-icon.png" alt="AI预警"><br>
        AI预警
    </div>
    <div class="module">
        <img src="data-stats-icon.png" alt="数据统计"><br>
        数据统计
    </div>
    <div class="module">
        <img src="flight-plan-icon.png" alt="航线规划"><br>
        航线规划
    </div>
    <div class="module">
        <img src="task-management-icon.png" alt="任务管理"><br>
        任务管理
    </div>
    <div class="module">
        <img src="device-management-icon.png" alt="设备管理"><br>
        设备管理
    </div>
    <div class="module">
        <img src="team-management-icon.png" alt="团队管理"><br>
        团队管理
    </div>
</div>

<div class="carousel" id="carousel">
    <img src="drone-image1.jpg" alt="Drone Image">
    <img src="drone-image2.jpg" alt="Drone Image">
    <img src="drone-image3.jpg" alt="Drone Image">
</div>

<script>
    let currentImageIndex = 0;
    const images = document.querySelectorAll('#carousel img');
    const carousel = document.getElementById('carousel');

    function showCarousel() {
        carousel.style.display = 'block';
        showImage(0);
    }

    function showImage(index) {
        images.forEach(img => img.style.display = 'none');
        images[index].style.display = 'block';
    }

    function nextImage() {
        currentImageIndex = (currentImageIndex + 1) % images.length;
        showImage(currentImageIndex);
    }

    function prevImage() {
        currentImageIndex = (currentImageIndex - 1 + images.length) % images.length;
        showImage(currentImageIndex);
    }

    function login() {
        var username = document.getElementById('username').value;
        var password = document.getElementById('password').value;
        
        if (username === "admin" && password === "admin") {
            document.querySelector('.login-container').style.display = 'none';
            document.querySelector('.modules').style.display = 'flex';
        } else {
            alert('用户名或密码错误');
        }
    }
</script>

</body>
</html>
